var express = require('express');
var router = express.Router();
const communityController = require('../../controller/web/community');

// 获取推荐帖子
router.get('/recommend', communityController.getRecommend);

// 获取热门帖子
router.get('/hot', communityController.getHot);

// 获取帖子列表（分页/筛选/排序）
router.get('/list', communityController.getList);

// 搜索
router.get('/search', communityController.search);

// 点赞
router.post('/like', communityController.like);

// 获取帖子详情
router.get('/detail/:id', communityController.getDetail);

// 获取评论列表 - 完全公开，无需任何验证
router.get('/comment/list/:id', communityController.getCommentList);
router.get('/:id/comments', communityController.getCommentList);

// 发表评论 - 需要发布者信息
router.post('/comment', communityController.addComment);
router.post('/:id/comment', communityController.addComment);

// 获取统计数据
router.get('/statistics', communityController.getStatistics);

// 获取分类列表
router.get('/categories', communityController.getCategories);

module.exports = router;


